﻿<KCtl:BaseUserControl x:Class="Kiva7.Pages.SearchLoanImageControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:KCtl="clr-namespace:Kiva7.Controls"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <Grid>

        <ProgressBar Visibility="{Binding IsLoaded, Converter={StaticResource booleanToNotVisibility}}" 
                     IsIndeterminate="{Binding IsLoaded, Converter={StaticResource notBooleanConverter}}" 
                     Style="{StaticResource CustomIndeterminateProgressBar}"
                     VerticalAlignment="Center" />

        <ScrollViewer Visibility="{Binding IsLoaded, Converter={StaticResource booleanToVisibility}}">

            <StackPanel x:Name="LayoutRoot" Background="{StaticResource KivaBackgroundBrush}"
                        DataContext="{Binding SingleData}">

                <StackPanel Style="{StaticResource KivaPanelTextLargeStyle}" Margin="12,0">
                    <TextBlock Text="{Binding Name}" Style="{StaticResource KivaTextLargeStyle}"
                           TextWrapping="Wrap"/>
                </StackPanel>

                <Button Click="Button_Click" BorderThickness="0" Margin="0,0,0,0">
                    <KCtl:KivaImageControl x:Name="imgLender" 
                           ImageSize="Normal"
                                           ImageData="{Binding Image}" Width="325" Height="250"/>
                </Button>

                <TextBlock x:Name="LoanID" Text="{Binding ID}" Visibility="Collapsed"/>

                <Button Click="AddLoan_Click"
                        Style="{StaticResource KivaButtonStyle}"
                        Visibility="{Binding IsSelected, Converter={StaticResource booleanToNotVisibility}}">
                    <TextBlock Text="{Binding Path=L.AddLoanToBasket, Source={StaticResource L}}" 
                           TextAlignment="Center"
                           TextWrapping="Wrap"  
                           Style="{StaticResource KivaButtonTextStyle}"/>
                </Button>
                <StackPanel Style="{StaticResource KivaDetailStyle}">
                    <KCtl:TranslationControl x:Name="useTranslation" DataContext="{Binding Description.Texts.Translation}" />
                </StackPanel>

            </StackPanel>
        </ScrollViewer>
    </Grid>
</KCtl:BaseUserControl>
